\section*{Ex. 1}
\begin{enumerate}
\item Write a program that performs the sum of the squares of the integers from
$n$ to $m\ge n$
\begin{equation*}
n^2 + \left(n+1\right)^2 + \ldots + m^2
\end{equation*}
saving the result in the variable \cpp{sum} with type \cpp{double} and printing
the result to screen. The values for $n$ and $m$ are set using the keyboard.
\item Verify what happens if the variable \cpp{sum} is of \cpp{int} type with
$n=1$ and $m=2000$. Justify the result using the \emph{$<$limits$>$} module
from the standard library.
\item Modify the program in order to have the variables \cpp{n} and \cpp{m}
introduced from command line at program start, i.e. this is a valid
\begin{verbatim}
./sum 1 15
\end{verbatim}
\end{enumerate}

\section*{Ex. 2}
\begin{enumerate}
\item Modify the above program saving all the partial sums in a variable
\cpp{psum} of type \cpp{std::vector<double>}. Initialize the vector using the
members \cpp{resize} and \cpp{operator[]}. Print out the values looping on
the vector using indices.
\item Build the vector \cpp{psum} using the alternative way of reserving a
sufficient space for the number of elements beforehand using the member
\cpp{reserve} and insert the elements with the member \cpp{push\_back}.
Verify the evolution of the dimension of the vector during the insertion of the
elements. Check what happens if the elements are inserted using the member
\cpp{operator[]} instead of the member \cpp{push\_back}.

\item (\emph{Optional}) Compute the vector of the partial sums for $n=1$, $m=15$
and assign the first $10$ values to a new vector \cpp{psum10} of the same type
using the \cpp{assign} member.
\end{enumerate}
